@mixin center-container {
  width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

@mixin flex-row($center: 0) {
  display: flex;
  flex-direction: row;
  @include flex-center($center)
}

@mixin flex-column($center: 0) {
  display: flex;
  flex-direction: column;
  @include flex-center($center)
}

@mixin flex-center($center: 0) {
  @if ($center == 1) {
    align-items: center;
  } @else if ($center == 2) {
    align-items: center;
    justify-content: center;
  }
}

@mixin text-ellipsis($center: 0) {
  overflow: hidden;
  text-overflow: ellipsis;
  @include text-lines($center)
}

@mixin text-lines($center: 0) {
  @if ($center > 1) {
    display: -webkit-box;
    -webkit-line-clamp: $center;
    -webkit-box-orient: vertical;
  } @else {
    white-space: nowrap;
  }
}

@mixin icon-sizes($size: 14) {
  width: $size+px;
  line-height: $size+px;
  font-size: $size+px;
}

@mixin btn-sizes($height, $padding, $borderColor, $radius, $color, $borderWidth: 1) {
  height: $height+px;
  padding: 0 $padding+px;
  border: 1px solid $borderColor;
  border-radius: $radius+px;
  color: $color;
}

@mixin btn-hover($bgColor: null) {
  &:active {
    opacity: 0.6;
    @if ($bgColor) {
      background-color: $bgColor;
    }
  }
}

@mixin scroll-bar($size: 6, $thumbBg: #b4bccc, $trackBg: #fff) {
  $--scrollbar-thumb-background: $thumbBg;
  $--scrollbar-track-background: $trackBg;

  &::-webkit-scrollbar {
    z-index: 11;
    width: $size+px;

    &:horizontal {
      height: $size+px;
    }

    &-thumb {
      border-radius: 5px;
      width: $size+px;
      background: $--scrollbar-thumb-background;
    }

    &-corner {
      background: $--scrollbar-track-background;
    }

    &-track {
      background: $--scrollbar-track-background;

      &-piece {
        background: $--scrollbar-track-background;
        width: $size+px;
      }
    }
  }
}

/**箭头展开动画**/
@mixin arrowTransform {
  transition: 0.3s ease;
  transform-origin: center;
  transform: rotateZ(180deg);
}

/**箭头收起动画**/
@mixin arrowTransformReturn {
  transition: 0.3s ease;
  transform-origin: center;
  transform: rotateZ(0deg);
}

/**淡入淡出动画**/
@mixin fade-animation() {
  .a-fade-enter-active {
    transition: opacity .5s;
  }

  .a-fade-enter {
    opacity: 0;
  }

  .a-fade-leave-active {
    transition: opacity .5s;
  }

  .a-fade-leave-to {
    opacity: 0;
  }
}
